/*
 * @Author: sympsel sympsel@outlook.com
 * @Date: 2025-07-14 15:14:40
 * @LastEditors: sympsel sympsel@outlook.com
 * @LastEditTime: 2025-07-14 16:13:05
 * @FilePath: \work25_7_14\src\SeqList.h
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
#pragma once
#include <stdio.h>
#include <assert.h>
#include <stdlib.h>
#include <stdbool.h>

#define MALLOC(type, count) (type*)malloc(sizeof(type) * count)

#define DEFAULT_CAPACITY 10

typedef int SLDateType;
typedef struct SeqList {
	SLDateType* data;
	int size;
	int capacity;
}SeqList;

// 对数据的管理:增删查改 
SeqList* SeqListInit();
void SeqListDestroy(SeqList* list);

void SeqListPrint(SeqList* list);

void SeqListPushBack(SeqList* list, SLDateType data);

void SeqListPushFront(SeqList* list, SLDateType data);

void SeqListPopFront(SeqList* list);

void SeqListPopBack(SeqList* list);

// 顺序表查找
bool SeqListFind(SeqList* list, SLDateType data);
// 顺序表在pos位置插入x
void SeqListInsert(SeqList* list, int pos, SLDateType data);
// 顺序表删除pos位置的值
void SeqListErase(SeqList* list, int pos);